import asyncio
from mcp.server.fastmcp import FastMCP
from tools.migrate_vm_tool import migrate_vm_advanced
from tools.get_vm_tool import get_esxi_vm_list
from tools.create_vm_tool import create_vm
from tools.power_off_tool import power_off_host
from tools.power_on_tool import power_on_host

# 初始化MCP服务
mcp = FastMCP("vCenter-mcp")

# 注册工具函数
mcp.tool()(create_vm)
mcp.tool()(get_esxi_vm_list)
mcp.tool()(migrate_vm_advanced)
mcp.tool()(power_off_host)
mcp.tool()(power_on_host)

if __name__ == "__main__":
    # 启动MCP服务，使用stdio通信
    mcp.run(transport='stdio')

